congress = read.csv('more-data/all_w_IBM_50.csv')
# clean data - convert to numeric
congress[is.na(congress)] = 0
congress$gender = as.numeric(congress$gender)
congress$type = as.numeric(congress$type)
congress$party = as.numeric(congress$party)
congress
#round_ones = function(col){
# col[col != 0] = 1
# col
#}
#round_ones(congress$Joy)
congress$Sadness[congress$Sadness != 0] = 1
congress$Joy[congress$Joy != 0] = 1
congress$Tentative[congress$Tentative != 0] = 1
congress$Confident[congress$Confident != 0] = 1
congress$Analytical[congress$Analytical != 0] = 1
congress$Anger[congress$Anger != 0] = 1
congress$Fear[congress$Fear != 0] = 1
congress
women_tweets = congress[congress$gender == 1,]
men_tweets = congress[congress$gender == 2,]
t.test(women_tweets$Sadness, men_tweets$Sadness) #, var.equal = TRUE)
Welch Two Sample t-test
data: women_tweets$Sadness and men_tweets$Sadness
t = 3.7961, df = 10593, p-value = 0.0001478
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.00915687 0.02870989
sample estimates:
mean of x mean of y
0.08186916 0.06293578
t.test(women_tweets$Joy, men_tweets$Joy)
Welch Two Sample t-test
data: women_tweets$Joy and men_tweets$Joy
t = -4.1526, df = 10793, p-value = 3.313e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.05229073 -0.01875445
sample estimates:
mean of x mean of y
0.2540187 0.2895413
t.test(women_tweets$Tentative, men_tweets$Tentative)
Welch Two Sample t-test
data: women_tweets$Tentative and men_tweets$Tentative
t = 1.4584, df = 10730, p-value = 0.1448
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.002009026 0.013686982
sample estimates:
mean of x mean of y
0.04822430 0.04238532
t.test(women_tweets$Analytical, men_tweets$Analytical)
Welch Two Sample t-test
data: women_tweets$Analytical and men_tweets$Analytical
t = 5.0816, df = 10675, p-value = 3.806e-07
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.02222660 0.05014243
sample estimates:
mean of x mean of y
0.1820561 0.1458716
t.test(women_tweets$Confident, men_tweets$Confident)
Welch Two Sample t-test
data: women_tweets$Confident and men_tweets$Confident
t = 1.185, df = 10761, p-value = 0.236
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.003708367 0.015046788
sample estimates:
mean of x mean of y
0.06897196 0.06330275
t.test(women_tweets$Fear, men_tweets$Fear)
Welch Two Sample t-test
data: women_tweets$Fear and men_tweets$Fear
t = 2.2784, df = 10208, p-value = 0.02272
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.0005934379 0.0079052331
sample estimates:
mean of x mean of y
0.01158879 0.00733945
t.test(women_tweets$Anger, men_tweets$Anger)
Welch Two Sample t-test
data: women_tweets$Anger and men_tweets$Anger
t = -0.38681, df = 10791, p-value = 0.6989
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.003724927 0.002497112
sample estimates:
mean of x mean of y
0.006542056 0.007155963
dep = congress$tweet_favorite_count
w_tweets = dep[congress$gender == 1]
g = split(congress, congress$gender)
wom = split(g$`1`, g$`1`$Confident) # women
men = split(g$`2`, g$`2`$Confident) # men
one = wom$`0` # not conf women
two = wom$`1` # conf women
three = men$`0` # not conf men
four = men$`1` # conf men
f = function(dat){
log(1+log(1+dat$tweet_favorite_count))#[dat$tweet_favorite_count>0]))
}
#congress$tweet_favorite_count>0
hist(f(congress), main='Favorites ~ Power Law', xlab='log log favorites')
barplot(c(mean(f(one)), mean(f(two)), mean(f(three)), mean(f(four))), names.arg=c('Women Neutral', 'Women Confident', 'Men Neutral', 'Men Confident'), main = 'Favorites vs. Confidence and Gender', ylab= 'log log favorite (mean)')
boxplot(f(one), f(two), f(three), f(four), ylab='log favorites', names = c('Women not conf', 'Women conf', 'Men not conf', 'Men conf'), main='Men more rewarded for confidence')
dep = f(congress)
mfav10 = lm(dep ~ congress$Confident + congress$gender) # both effects significant, women are favorited more
mfavint0 = lm(dep ~ congress$Confident * congress$gender)
anova(mfav10, mfavint0)
Analysis of Variance Table
Model 1: dep ~ congress$Confident + congress$gender
Model 2: dep ~ congress$Confident * congress$gender
Res.Df RSS Df Sum of Sq F Pr(>F)
1 10797 3986.1
2 10796 3984.7 1 1.4019 3.7983 0.05133 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
f = function(dat){
log(1+log(1+dat$tweet_favorite_count[dat$tweet_favorite_count>0]))
}
#dep = log(1+congress$tweet_favorite_count)
fact = congress$tweet_favorite_count > 0
dep = f(congress)
mfav0 = lm(dep ~ congress$Confident[fact]) # positive, significant
mfav1 = lm(dep ~ congress$Confident[fact] + congress$gender[fact]) # both effects significant, women are favorited more
mfavint = lm(dep ~ congress$Confident[fact] * congress$gender[fact])
summary(mfav0)
Call:
lm(formula = dep ~ congress$Confident[fact])
Residuals:
Min 1Q Median 3Q Max
-0.8680 -0.2417 -0.0116 0.2121 1.2159
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.322110 0.003998 330.670 < 2e-16 ***
congress$Confident[fact] 0.072468 0.014816 4.891 1.02e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3595 on 8718 degrees of freedom
Multiple R-squared: 0.002737, Adjusted R-squared: 0.002622
F-statistic: 23.92 on 1 and 8718 DF, p-value: 1.021e-06
summary(mfav1)
Call:
lm(formula = dep ~ congress$Confident[fact] + congress$gender[fact])
Residuals:
Min 1Q Median 3Q Max
-0.9186 -0.2413 -0.0144 0.2062 1.1791
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.477872 0.011982 123.34 < 2e-16 ***
congress$Confident[fact] 0.072262 0.014659 4.93 8.39e-07 ***
congress$gender[fact] -0.104970 0.007622 -13.77 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3557 on 8717 degrees of freedom
Multiple R-squared: 0.02397, Adjusted R-squared: 0.02375
F-statistic: 107.1 on 2 and 8717 DF, p-value: < 2.2e-16
summary(mfavint)
Call:
lm(formula = dep ~ congress$Confident[fact] * congress$gender[fact])
Residuals:
Min 1Q Median 3Q Max
-0.91199 -0.24071 -0.01492 0.20710 1.17969
Coefficients:
Estimate Std. Error t value
(Intercept) 1.479463 0.012394 119.367
congress$Confident[fact] 0.050439 0.045884 1.099
congress$gender[fact] -0.106042 0.007916 -13.396
congress$Confident[fact]:congress$gender[fact] 0.014724 0.029338 0.502
Pr(>|t|)
(Intercept) <2e-16 ***
congress$Confident[fact] 0.272
congress$gender[fact] <2e-16 ***
congress$Confident[fact]:congress$gender[fact] 0.616
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3557 on 8716 degrees of freedom
Multiple R-squared: 0.024, Adjusted R-squared: 0.02367
F-statistic: 71.45 on 3 and 8716 DF, p-value: < 2.2e-16
anova(mfav1, mfavint) # reject mfav1 at p~.05, means there is an interaction. NOT IF WE REMOVE ZERO-valued tweets!
Analysis of Variance Table
Model 1: dep ~ congress$Confident[fact] + congress$gender[fact]
Model 2: dep ~ congress$Confident[fact] * congress$gender[fact]
Res.Df RSS Df Sum of Sq F Pr(>F)
1 8717 1102.8
2 8716 1102.8 1 0.031871 0.2519 0.6158
#four$IBM_text[four$tweet_favorite_count==0]
5
[1] 5
agged = aggregate(congress, by=list(congress$twitter), FUN=function(x) mean(as.numeric(x)))
#mean)
congress
agged
hi
women = agged[agged$gender == 1,]
women
men = agged[agged$gender == 2,]
men
#agged$Anger[agged$Anger != 0]
measure = "Politician IBM score (mean)"
shapiro.test(women$Joy) # not normally distributed
Shapiro-Wilk normality test
data: women$Joy
W = 0.97917, p-value = 0.09117
shapiro.test(women$Tentative)
Shapiro-Wilk normality test
data: women$Tentative
W = 0.91906, p-value = 6.638e-06
hist(women$Sadness)
hist(women$Joy, xlab=measure, main='Joy - Approximately normal (p > .05)')
hist(women$Tentative, xlab=measure, main='Tentative - Not approx. normal (p < 1e-05)')
hist(women$Analytical)
hist(women$Confident)
hist(women$Fear)
hist(women$Anger)
indep_col_1 = rgb(0,0,1,1/4)
indep_col_2 = rgb(1,0,0,1/4)
depw = women$Analytical
depm = men$Analytical
hist(depw, col=indep_col_1, main='Women as or more Analytical', xlab=measure)
hist(depm, col=indep_col_2, add=T)
legend1 = "Analytical - women"
legend2 = "Analytical - men"
legend(.25, 30, legend=c(legend1, legend2),
col=c(indep_col_1, indep_col_2), lty=1, lwd=10, cex=0.8)
d = data.frame(women=depw, men=depm[1:107])
boxplot(d, main='Women as or more Analytical', ylab=measure)
#stripchart(d,
# vertical = TRUE, #method = "jitter",
# pch = 21, col = "maroon", bg = "bisque",
# add = TRUE)
#hist(women$Sadness, col=indep_col_1)
#hist(men$Sadness, col=indep_col_2, add=T)
#plot(p1, col='blue')
d = data.frame(women_sad=women$Sadness, men_sad=men$Sadness[1:107], women_joy = women$Joy, men_joy = men$Joy[1:107])
boxplot(d, main='Women not more \"agreeable\"', ylab=measure, names = c("Women sad", "Men sad", "Women joy", "Men joy"))
d2 = data.frame(women_conf=women$Confident, men_conf = men$Confident[1:107], women_analytic=women$Analytical, men_analytic = men$Analytical[1:107])
boxplot(d2, main='Women as or more \"forceful\"', ylab=measure, names = c("Women conf", "Men conf", "Women analytical", "Men analytical"))
t.test(women$Sadness, men$Sadness) #, var.equal = TRUE)
Welch Two Sample t-test
data: women$Sadness and men$Sadness
t = 3.3452, df = 207.69, p-value = 0.0009757
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.007775157 0.030091601
sample estimates:
mean of x mean of y
0.08186916 0.06293578
t.test(women$Joy, men$Joy)
Welch Two Sample t-test
data: women$Joy and men$Joy
t = -2.6595, df = 212.49, p-value = 0.008422
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.061851649 -0.009193536
sample estimates:
mean of x mean of y
0.2540187 0.2895413
t.test(women$Tentative, men$Tentative)
Welch Two Sample t-test
data: women$Tentative and men$Tentative
t = 1.2482, df = 212.44, p-value = 0.2133
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.00338211 0.01506007
sample estimates:
mean of x mean of y
0.04822430 0.04238532
t.test(women$Analytical, men$Analytical)
Welch Two Sample t-test
data: women$Analytical and men$Analytical
t = 3.8041, df = 214, p-value = 0.0001857
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.01743531 0.05493372
sample estimates:
mean of x mean of y
0.1820561 0.1458716
x = t.test(women$Confident, men$Confident)
x
Welch Two Sample t-test
data: women$Confident and men$Confident
t = 1.0942, df = 209.23, p-value = 0.2751
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.004544338 0.015882759
sample estimates:
mean of x mean of y
0.06897196 0.06330275
x$conf.int
[1] -0.004544338 0.015882759
attr(,"conf.level")
[1] 0.95
x$estimate
mean of x mean of y
0.06897196 0.06330275
# t.test(women$Confident, men$Confident, alternative = 'greater')
t.test(women$Fear, men$Fear)
Welch Two Sample t-test
data: women$Fear and men$Fear
t = 2.0704, df = 209.34, p-value = 0.03965
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.0002031941 0.0082954769
sample estimates:
mean of x mean of y
0.01158879 0.00733945
t.test(women$Anger, men$Anger)
Welch Two Sample t-test
data: women$Anger and men$Anger
t = -0.32948, df = 209.51, p-value = 0.7421
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.004287036 0.003059222
sample estimates:
mean of x mean of y
0.006542056 0.007155963
fuller models into party, age.
sad women remains stat sig even with party; some small evidence for involving the fuller model with an additive party or interacted party.
msad1 = lm(agged$Sadness ~ agged$gender)
msad11 = lm(agged$Sadness ~ agged$party)
msad111 = lm(agged$Sadness ~ agged$age)
#plot(msad111)
#plot(agged$age, agged$Sadness)
#abline(msad111)
summary(msad1)
Call:
lm(formula = agged$Sadness ~ agged$gender)
Residuals:
Min 1Q Median 3Q Max
-0.081869 -0.022936 -0.002936 0.018131 0.158131
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.100803 0.008961 11.25 < 2e-16 ***
agged$gender -0.018933 0.005652 -3.35 0.000955 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.04153 on 214 degrees of freedom
Multiple R-squared: 0.04983, Adjusted R-squared: 0.04539
F-statistic: 11.22 on 1 and 214 DF, p-value: 0.000955
# model involving party:
msad2 = lm(agged$Sadness ~ agged$gender + agged$party)
summary(msad2)
Call:
lm(formula = agged$Sadness ~ agged$gender + agged$party)
Residuals:
Min 1Q Median 3Q Max
-0.08392 -0.02486 -0.00392 0.02016 0.15608
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.107996 0.010538 10.248 < 2e-16 ***
agged$gender -0.016239 0.006016 -2.699 0.00751 **
agged$party -0.007838 0.006067 -1.292 0.19781
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.04146 on 213 degrees of freedom
Multiple R-squared: 0.05722, Adjusted R-squared: 0.04836
F-statistic: 6.463 on 2 and 213 DF, p-value: 0.001883
anova(msad1, msad2)
Analysis of Variance Table
Model 1: agged$Sadness ~ agged$gender
Model 2: agged$Sadness ~ agged$gender + agged$party
Res.Df RSS Df Sum of Sq F Pr(>F)
1 214 0.36909
2 213 0.36622 1 0.0028694 1.6689 0.1978
mjoy1 = lm(agged$Joy ~ agged$gender)
mjoy2 = lm(agged$Joy ~ agged$gender + agged$party)
mjoy3 = lm(agged$Joy ~ agged$gender + agged$party + agged$age)
summary(mjoy1)
Call:
lm(formula = agged$Joy ~ agged$gender)
Residuals:
Min 1Q Median 3Q Max
-0.209541 -0.074019 0.005981 0.067101 0.290459
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.21850 0.02120 10.307 < 2e-16 ***
agged$gender 0.03552 0.01337 2.657 0.00848 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.09824 on 214 degrees of freedom
Multiple R-squared: 0.03193, Adjusted R-squared: 0.02741
F-statistic: 7.059 on 1 and 214 DF, p-value: 0.00848
summary(mjoy2)
Call:
lm(formula = agged$Joy ~ agged$gender + agged$party)
Residuals:
Min 1Q Median 3Q Max
-0.19160 -0.06070 -0.00516 0.06840 0.32128
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.17177 0.02428 7.074 2.14e-11 ***
agged$gender 0.01802 0.01386 1.300 0.195027
agged$party 0.05090 0.01398 3.641 0.000341 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.09554 on 213 degrees of freedom
Multiple R-squared: 0.08866, Adjusted R-squared: 0.08011
F-statistic: 10.36 on 2 and 213 DF, p-value: 5.078e-05
summary(mjoy3)
Call:
lm(formula = agged$Joy ~ agged$gender + agged$party + agged$age)
Residuals:
Min 1Q Median 3Q Max
-0.20419 -0.06417 -0.00175 0.06619 0.32427
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.2249574 0.0487494 4.615 6.82e-06 ***
agged$gender 0.0177069 0.0138458 1.279 0.20234
agged$party 0.0466853 0.0143583 3.251 0.00134 **
agged$age -0.0007777 0.0006184 -1.258 0.20991
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.09541 on 212 degrees of freedom
Multiple R-squared: 0.09541, Adjusted R-squared: 0.08261
F-statistic: 7.454 on 3 and 212 DF, p-value: 9.084e-05
anova(mjoy1, mjoy2)
Analysis of Variance Table
Model 1: agged$Joy ~ agged$gender
Model 2: agged$Joy ~ agged$gender + agged$party
Res.Df RSS Df Sum of Sq F Pr(>F)
1 214 2.0654
2 213 1.9444 1 0.12104 13.259 0.0003406 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(mjoy2, mjoy3)
Analysis of Variance Table
Model 1: agged$Joy ~ agged$gender + agged$party
Model 2: agged$Joy ~ agged$gender + agged$party + agged$age
Res.Df RSS Df Sum of Sq F Pr(>F)
1 213 1.9444
2 212 1.9300 1 0.014399 1.5816 0.2099
mAnalytical1 = lm(agged$Analytical ~ agged$gender)
mAnalytical2 = lm(agged$Analytical ~ agged$gender + agged$party)
mAnalytical3 = lm(agged$Analytical ~ agged$gender * agged$party)
mAnalytical4 = lm(agged$Analytical ~ agged$gender + agged$party + agged$age)
summary(mAnalytical1)
Call:
lm(formula = agged$Analytical ~ agged$gender)
Residuals:
Min 1Q Median 3Q Max
-0.162056 -0.043010 -0.005872 0.037944 0.214128
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.218241 0.015084 14.469 < 2e-16 ***
agged$gender -0.036185 0.009513 -3.804 0.000186 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.06991 on 214 degrees of freedom
Multiple R-squared: 0.06332, Adjusted R-squared: 0.05894
F-statistic: 14.47 on 1 and 214 DF, p-value: 0.0001861
summary(mAnalytical2)
Call:
lm(formula = agged$Analytical ~ agged$gender + agged$party)
Residuals:
Min 1Q Median 3Q Max
-0.153177 -0.049106 -0.009106 0.048627 0.188395
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.257248 0.017075 15.066 < 2e-16 ***
agged$gender -0.021573 0.009748 -2.213 0.028 *
agged$party -0.042499 0.009830 -4.323 2.36e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.06718 on 213 degrees of freedom
Multiple R-squared: 0.1389, Adjusted R-squared: 0.1308
F-statistic: 17.18 on 2 and 213 DF, p-value: 1.214e-07
anova(mAnalytical1, mAnalytical2)
Analysis of Variance Table
Model 1: agged$Analytical ~ agged$gender
Model 2: agged$Analytical ~ agged$gender + agged$party
Res.Df RSS Df Sum of Sq F Pr(>F)
1 214 1.04579
2 213 0.96143 1 0.084364 18.69 2.361e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# interactions not needed.
anova(mAnalytical2, mAnalytical3)
Analysis of Variance Table
Model 1: agged$Analytical ~ agged$gender + agged$party
Model 2: agged$Analytical ~ agged$gender * agged$party
Res.Df RSS Df Sum of Sq F Pr(>F)
1 213 0.96143
2 212 0.95975 1 0.0016767 0.3704 0.5435
anova(mAnalytical2, mAnalytical4)
Analysis of Variance Table
Model 1: agged$Analytical ~ agged$gender + agged$party
Model 2: agged$Analytical ~ agged$gender + agged$party + agged$age
Res.Df RSS Df Sum of Sq F Pr(>F)
1 213 0.96143
2 212 0.95964 1 0.0017855 0.3944 0.5307
mConfident0 = lm(agged$Confident ~ agged$party)
mConfident1 = lm(agged$Confident ~ agged$gender)
mConfident2 = lm(agged$Confident ~ agged$gender + agged$party)
mConfident3 = lm(agged$Confident ~ agged$gender * agged$party)
mConfident4 = lm(agged$Confident ~ agged$gender + agged$party + agged$age)
summary(mConfident0)
Call:
lm(formula = agged$Confident ~ agged$party)
Residuals:
Min 1Q Median 3Q Max
-0.067705 -0.027705 -0.004043 0.015957 0.115957
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.071367 0.007937 8.992 <2e-16 ***
agged$party -0.003662 0.005227 -0.701 0.484
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.03809 on 214 degrees of freedom
Multiple R-squared: 0.002289, Adjusted R-squared: -0.002373
F-statistic: 0.4909 on 1 and 214 DF, p-value: 0.4843
summary(mConfident1)
Call:
lm(formula = agged$Confident ~ agged$gender)
Residuals:
Min 1Q Median 3Q Max
-0.068972 -0.028972 -0.003303 0.016697 0.116697
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.074641 0.008204 9.098 <2e-16 ***
agged$gender -0.005669 0.005175 -1.096 0.274
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.03802 on 214 degrees of freedom
Multiple R-squared: 0.005578, Adjusted R-squared: 0.0009309
F-statistic: 1.2 on 1 and 214 DF, p-value: 0.2745
summary(mConfident2)
Call:
lm(formula = agged$Confident ~ agged$gender + agged$party)
Residuals:
Min 1Q Median 3Q Max
-0.069472 -0.029472 -0.003504 0.017451 0.115541
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.076394 0.009684 7.889 1.58e-13 ***
agged$gender -0.005013 0.005528 -0.907 0.366
agged$party -0.001910 0.005575 -0.343 0.732
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.0381 on 213 degrees of freedom
Multiple R-squared: 0.006125, Adjusted R-squared: -0.003207
F-statistic: 0.6563 on 2 and 213 DF, p-value: 0.5198
anova(mConfident1, mConfident2)
Analysis of Variance Table
Model 1: agged$Confident ~ agged$gender
Model 2: agged$Confident ~ agged$gender + agged$party
Res.Df RSS Df Sum of Sq F Pr(>F)
1 214 0.30940
2 213 0.30923 1 0.00017033 0.1173 0.7323
# interactions not needed.
anova(mConfident2, mConfident3)
Analysis of Variance Table
Model 1: agged$Confident ~ agged$gender + agged$party
Model 2: agged$Confident ~ agged$gender * agged$party
Res.Df RSS Df Sum of Sq F Pr(>F)
1 213 0.30923
2 212 0.30916 1 6.9315e-05 0.0475 0.8276
anova(mConfident2, mConfident4)
Analysis of Variance Table
Model 1: agged$Confident ~ agged$gender + agged$party
Model 2: agged$Confident ~ agged$gender + agged$party + agged$age
Res.Df RSS Df Sum of Sq F Pr(>F)
1 213 0.30923
2 212 0.30830 1 0.00092298 0.6347 0.4265
# HELLO, SAVE!